Skip to main content

https://img.shields.io/pypi/v/yasa.svg https://img.shields.io/github/license/raphaelvallat/yasa.svg https://codecov.io/gh/raphaelvallat/yasa/branch/master/graph/badge.svg https://static.pepy.tech/badge/yasa Ruff
https://raw.githubusercontent.com/raphaelvallat/yasa/refs/tags/v0.6.5/docs/pictures/yasa_logo.png

YASA (Yet Another Spindle Algorithm) is a command-line sleep analysis toolbox in Python. The main functions of YASA are:

  • Automatic sleep staging of polysomnography data (see eLife article).

  • Event detection: sleep spindles, slow-waves and rapid eye movements, on single or multi-channel EEG data.

  • Artefact rejection, on single or multi-channel EEG data.

  • Spectral analyses: bandpower, phase-amplitude coupling, 1/f slope, and more!

  • Hypnogram analysis: sleep statistics, stage transitions, visualization, and manipulation.

For more details, try the tutorials or read the FAQ.


Installation

User installation

YASA can be easily installed using pip, conda, or uv:

uv pip install yasa
pip install --upgrade yasa
conda install -c conda-forge yasa

Some features require optional dependencies. Install them with extras:

pip install "yasa[full]"    # all optional dependencies

Install from source

To build and install from source, clone this repository and install in editable mode with uv

git clone https://github.com/raphaelvallat/yasa.git
cd yasa
uv pip install --group=test --editable .

# test the package
pytest --verbose

For common questions about prerequisites, data formats, and how to load EEG data, see the FAQ.

How do I get started with YASA?

The best starting point is the tutorials section of the documentation, which includes a quickstart guide and step-by-step walkthroughs of the most common workflows.

Additional worked examples are available as Jupyter notebooks on GitHub. Note that some notebooks may not reflect the latest API.

Development

YASA was created and is maintained by Raphael Vallat. Contributions are more than welcome! See the contributing guide for guidelines.

To see the code or report a bug, please visit the GitHub repository.

Note that this program is provided with NO WARRANTY OF ANY KIND.

Citation

To cite YASA, please use the eLife publication:

Metadata

Release files for yasa 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yasa 0.8.0
File Size Uploaded
yasa-0.8.0.tar.gz 27.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for yasa 0.8.0
File Interpreter ABI Platform
yasa-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 54.9 MB

Release files / yasa-0.8.0.tar.gz

Download URL yasa-0.8.0.tar.gz
Size 27.5 MB
Tags Source
SHA-256 checksum
How to use checksums
0a31a036baf254f0d5ec1932237e3c56bbfe78659008ea50d796d74817fb4e6f
BLAKE2b-256 checksum
How to use checksums
3266ddc67d972d4a88872bf21ee9b10c9a7fa92357c40954aa237886fe3a8ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / yasa-0.8.0-py3-none-any.whl

Download URL yasa-0.8.0-py3-none-any.whl
Size 27.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f7c6d5d8e997d0b6eb4fa2903f810578911dbebf2646bb1b962b1181d682164f
BLAKE2b-256 checksum
How to use checksums
959efda1736810bc8e31f0f60819115ea7a5f5fbca859c6c344d0fd31c3de06d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.0

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page